package com.zzzy.framework.common.util;

import java.util.Objects;

/**
 * Description: 数据权限校验标识
 *
 * @author fc
 * @date 2024/5/20
 */
public class DataPermissionHolder {
    private static final ThreadLocal<Boolean> DATA_PERMISSION_HOLDER = new ThreadLocal<>();

    public static Boolean getIsFilterData() {
        return Objects.isNull(DATA_PERMISSION_HOLDER.get()) ? Boolean.FALSE : DATA_PERMISSION_HOLDER.get();
    }

    public static void setIsFilterData(Boolean isFilterData) {
        DATA_PERMISSION_HOLDER.set(isFilterData);
    }

    public static void clearContext() {
        DATA_PERMISSION_HOLDER.remove();
    }
}
